import 'package:flutter/material.dart';

import '../../../common/system_config.dart';
import '../../../utils/tools/screenutil_tool.dart';

class AlarmNumerWidget extends StatelessWidget {
  int num = 0;

  AlarmNumerWidget({int num}) {
    if(num !=null){
      this.num = num;
    }
  }

  @override
  Widget build(BuildContext context) {
    return this.num > 0 ? Container(
        padding: EdgeInsets.symmetric(vertical: ST.setw(10), horizontal: ST.setw(20)),
        decoration: BoxDecoration(
            color: Colors.red,
            borderRadius: BorderRadius.all(Radius.circular(10))
        ),
        child:Text('未处理告警数：${num}', style: TextStyle(color: Colors.white,fontSize: ST.setsp(26)))
    ):Text('未处理告警数：0',style: TextStyle(fontSize: SystemConfig.fs_content3));
  }
}